/*
 * ZonaCanastos.cpp
 *
 *  Created on: 16/11/2013
 *      Author: gonzalo
 */

#include "AdminKeys.h"

AdminKeys::AdminKeys(std::string zona, std::string subZona) {
	this->zona = zona;
	this->subZona = subZona;
	if (this->zona.compare(ZONA_IZQ) == 0){
		this->agvKey = 'i';
		this->r11Key = 'i';
		this->r12LeftKey = 'i';
		this->cintaKey = 'i';
		this->canastosKey = 'i';
	} else if (this->zona.compare(ZONA_DER) == 0) {
		this->agvKey = 'd';
		this->r11Key = 'd';
		this->r12RightKey = 'd';
		this->cintaKey = 'd';
		this->canastosKey = 'd';
	} else if (this->zona.compare(ZONA_MED) == 0){
		this->agvKey = 'm';
		this->canastosKey = 'm';
		this->r12LeftKey = 'i';
		this->r12RightKey= 'd';
		if (this->subZona.compare(SUBZONA_IZQ) == 0) {
			this->r11Key = 'i';
			this->cintaKey = 'i';
		} else if (this->subZona.compare(SUBZONA_DER) == 0) {
			this->r11Key = 'd';
			this->cintaKey = 'd';
		} else {
			this->r11Key = -1;
			this->cintaKey = -1;
		}
	}
}

AdminKeys::~AdminKeys() {
}

bool AdminKeys::compartida() {
	return this->zona == ZONA_MED;
}

char AdminKeys::getRobot11Key() {
	return this->r11Key;
}

char AdminKeys::getAgvKey() {
	return this->agvKey;
}

char AdminKeys::getCintaKey() {
	return this->cintaKey;
}

char AdminKeys::getCanastosKey() {
	return this->canastosKey;
}

char AdminKeys::getRobot12Key() {
	if (this->zona.compare(ZONA_IZQ) == 0 || this->subZona.compare(SUBZONA_IZQ) == 0) {
		return this->getLeftRobot12Key();
	} else if (this->zona.compare(ZONA_DER) == 0 || this->subZona.compare(SUBZONA_DER) == 0){
		return this->getRightRobot12Key();
	}
	return -1;
}

char AdminKeys::getLeftRobot12Key() {
	return this->r12LeftKey;
}

char AdminKeys::getRightRobot12Key() {
	return this->r12RightKey;
}

